package com.business.business.config.mybatisplus;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 *
 * MybatisPlus配置 ---------------------------------
 *
 * @author :
 */
@Configuration
@MapperScan({ "com.business.business.web.**.mapper*"})//扫描mapper的Java文件
public class MybatisPlusConfig {
    /**
     * 转驼峰拦截器
     *
     * @return
     */
    @Bean
    public CameHumpInterceptor cameHumpInterceptor() {
        return new CameHumpInterceptor();
    }
    /**
     * 分页插件，自动识别数据库类型
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        //paginationInterceptor.setLocalPage(true);
        paginationInterceptor.setDialectType("mysql");
        return paginationInterceptor;
    }
}
